﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;

namespace SportStore.DomainModel.Entities
{
    public class CreditCard : IDataErrorInfo
    {
        public string CardNumber { get; set; }
        public string CardHolderName { get; set; }
        public string ExpiryDate { get; set; }
        public string SecurityCode { get; set; }

        public string this[string columnsName]
        {
            get
            {
                if ((columnsName == "CardNumber") && string.IsNullOrEmpty(CardNumber)) return "Please enter a Card Number";
                if ((columnsName == "CardHolderName") && string.IsNullOrEmpty(CardHolderName)) return "Please enter a holder 's name";
                if ((columnsName == "ExpiryDate") && string.IsNullOrEmpty(ExpiryDate)) return "Please enter a epired date";
                if ((columnsName == "SecurityCode") && string.IsNullOrEmpty(SecurityCode)) return "Please enter a security code";
                return null;
            }
        }

        public string Error { get { return null; } }
    }
}
